﻿// HSS.Interlink.Web.Response.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.html)
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       Response.cs
// Author:     HSS\gbanta
// Created:    07/16/2011
// Modified:   07/22/2011
// ----------------------------------------------------------------------------
namespace HSS.Interlink.Web
{
	#region Using Directives

	#endregion

	#region Responses
	/// <summary>
	/// Contains the ResponseCommands
	/// </summary>
	internal static class Response
	{
		/// <summary>
		/// file-already-exists
		/// </summary>
		public static string FileAlreadyExists = "file-already-exists";
		/// <summary>
		/// file-does-not-exist
		/// </summary>
		public static string FileDoesNotExist = "file-does-not-exist";
		/// <summary>
		/// Unauthorized request
		/// </summary>
		public static string UnauthorizedRequest = "Unauthorized request";
		/// <summary>
		/// Unknown exception
		/// </summary>
		public static string UnknownException = "Unknown exception";
		/// <summary>
		/// Unknown request
		/// </summary>
		public static string UnknownRequest = "Unknown request";
		/// <summary>
		/// Save failed: ( File already exists )
		/// </summary>
		public static string SaveFailed_AlreadyExists = "Save failed: ( File already exists )";
		/// <summary>
		/// Save failed: ( Unknown error for file {0} )
		/// </summary>
		public static string SaveFailed_UnknownError = "Save failed: ( Unknown error )";
		/// <summary>
		/// The file does not contain any content
		/// </summary>
		public static string UploadFileIsEmpty = "The file does not contain any content";
		/// <summary>
		/// Errors encountered, please try again or contact your administrator
		/// </summary>
		public static string FatalError = "Errors encountered, please try again or contact your administrator";
		/// <summary>
		/// Gets the response string from the Resource Manager.
		/// </summary>
		/// <param name="response"></param>
		/// <returns></returns>
		public static string GetResponse(Responses response)
		{
			if (response == Responses.Success)
				return string.Empty;
			return Properties.Resources.ResourceManager.GetString(response.ToString());
		}
	}
	/// <summary>
	/// Contains the ResponseCommands
	/// </summary>
	public enum Responses
	{
		/// <summary>
		/// Success or empty string response
		/// </summary>
		Success,
		/// <summary>
		/// file-already-exists
		/// </summary>
		FileAlreadyExists,
		/// <summary>
		/// file-does-not-exist
		/// </summary>
		FileDoesNotExist,
		/// <summary>
		/// Unauthorized request
		/// </summary>
		UnauthorizedRequest,
		/// <summary>
		/// Unknown exception
		/// </summary>
		UnknownException,
		/// <summary>
		/// Unknown request
		/// </summary>
		UnknownRequest,
		/// <summary>
		/// Save failed: ( File already exists )
		/// </summary>
		SaveFailed_AlreadyExists,
		/// <summary>
		/// Save failed: ( Unknown error for file {0} )
		/// </summary>
		SaveFailed_UnknownError,
		/// <summary>
		/// The file does not contain any content
		/// </summary>
		UploadFileIsEmpty,
		/// <summary>
		/// Retry the last chunk (only availble for Upload request's AppendFile method.
		/// </summary>
		AppendFileRetry,
		/// <summary>
		/// Errors encountered, please try again or contact your administrator
		/// </summary>
		FatalError
	}
	#endregion
}